import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import Login from '../views/Login.vue'
import UserList from '../views/Main/User/UserList'
import UserManage from '../views/Main/User/UserManage'
import WorkFlowList from '../views/Main/WorkFlow/WorkFlowList'
import WorkFlowManage from '../views/Main/WorkFlow/WorkFlowManage'
import NotFound from '../components/notfound'
import HomeMain from '../views/Main/MainPage'
import AdminInfo from '../views/AdminInfo'
import Notice from '../views/Main/Message/Notice'
import Task from '../views/Main/Task/Task'
import ChangePassword from  '../views/Main/User/change-pwd'
import Summary from '../views/Main/Summary/Summary'


Vue.use(VueRouter)


const routes = [
  
  {
    path: '/Home',
    // redirect:'/home/main',
    name: 'Home',
    component: Home,
    children:[
		{
			path: '/home/changePassword',
			name: 'ChangePassword',
			component: ChangePassword
			
		},
      {
        path: '/home/userlist',
        name: 'UserList',
        component: UserList
      },
      {
        path: '/home/usermanage',
        name: 'UserManage',
        component: UserManage
      },
      {
        path: '/home/workflowlist',
        name: 'WorkFlowList',
        component: WorkFlowList
      },
      {
        path: '/home/workflowmanage',
        name: 'WorkFlowManage',
        component: WorkFlowManage
      },
      {
        path:'/home/main',
        name:'HomeMain',
        component:HomeMain
      },
      {
        path:'/home/admin',
        name:'AdminInfo',
        component:AdminInfo
      },{
        path:'/home/notice',
        name:'Notice',
        component:Notice
      },{
        path:'/home/task',
        name:'Task',
        component:Task
      },{
		path:'/home/summary',
		name:'Summary',
		component:Summary
	  }
      
    ]
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path:'/login',
    redirect:'/login'
  },

  { 
    path: '*',
    component: NotFound 
  }
]

const router = new VueRouter({
  mode:'history',
  
  routes
})

export default router
